package com.yunhai.system.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.yunhai.system.mapper.PartyMapper;
import com.yunhai.system.domain.Party;
import com.yunhai.system.service.IPartyService;

import java.util.List;
import java.util.Map;

/**
 * 党的建设Service业务层处理
 *
 * @author jxj
 * @date 2021-01-21
 */
@Service
public class PartyServiceImpl extends ServiceImpl<PartyMapper, Party> implements IPartyService {

    @Override
    public List<Party> queryList(Party party) {
        LambdaQueryWrapper<Party> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(party.getTitle())) {
            lqw.eq(Party::getTitle, party.getTitle());
        }
        if (null != party.getType()) {
            lqw.eq(Party::getType, party.getType());
        }
        lqw.orderByDesc(Party::getCreateTime);

        return this.list(lqw);
    }
}
